﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="ScrollBarLineButton"
           TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="Cursor"
                Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border x:Name="Border"
                            Margin="1"
                            BorderThickness="1"
                            BorderBrush="White">
                        <Border.Background>
                            <SolidColorBrush Color="Black"
                                             Opacity="0.4"></SolidColorBrush>
                        </Border.Background>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0"
                                                         Storyboard.TargetName="Border"
                                                         Storyboard.TargetProperty="(Border.Background).Opacity"
                                                         To="0.6" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="HorizontalScrollBar"
                     TargetType="{x:Type ScrollBar}">
        <Grid>
            <RepeatButton HorizontalAlignment="Left"
                          Style="{StaticResource ScrollBarLineButton}"
                          Command="ScrollBar.LineLeftCommand">
                <RepeatButton.Content>
                    <Image Width="30"
                           Height="30"
                           Source="leftArrow.png"></Image>
                </RepeatButton.Content>
            </RepeatButton>
            <RepeatButton HorizontalAlignment="Right"
                          Style="{StaticResource ScrollBarLineButton}"
                          Command="ScrollBar.LineRightCommand">
                <RepeatButton.Content>
                    <Image Width="30"
                           Height="30"
                           Source="rightArrow.png"></Image>
                </RepeatButton.Content>
            </RepeatButton>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="VerticalScrollBar"
                     TargetType="{x:Type ScrollBar}">
        <Grid>
            <RepeatButton VerticalAlignment="Top"
                          Style="{StaticResource ScrollBarLineButton}"
                          Command="ScrollBar.LineUpCommand">
                <RepeatButton.Content>
                    <Image Width="30"
                           Height="30"
                           Source="upArrow.png"></Image>
                </RepeatButton.Content>
            </RepeatButton>
            <RepeatButton VerticalAlignment="Bottom"
                          Style="{StaticResource ScrollBarLineButton}"
                          Command="ScrollBar.LineDownCommand">
                <RepeatButton.Content>
                    <Image Width="30"
                           Height="30"
                           Source="downArrow.png"></Image>
                </RepeatButton.Content>
            </RepeatButton>
        </Grid>
    </ControlTemplate>

    <Style x:Key="{x:Type ScrollBar}"
           TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="OverridesDefaultStyle"
                Value="true" />
        <Style.Triggers>
            <Trigger Property="Orientation"
                     Value="Horizontal">
                <Setter Property="Template"
                        Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation"
                     Value="Vertical">
                <Setter Property="Template"
                        Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="HorizontalMetroScrollViewerStyle"
           TargetType="{x:Type ScrollViewer}">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Border x:Name="Bd">
                        <Grid>
                            <Border>
                                <ScrollContentPresenter></ScrollContentPresenter>
                            </Border>

                            <ScrollBar x:Name="PART_HorizontalScrollBar"
                                       Orientation="Horizontal"
                                       Value="{TemplateBinding HorizontalOffset}"
                                       Maximum="{TemplateBinding ScrollableWidth}"
                                       ViewportSize="{TemplateBinding ViewportWidth}"
                                       Visibility="Collapsed" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver"
                                 Value="True"
                                 SourceName="Bd">
                            <Setter Property="Visibility"
                                    Value="Visible"
                                    TargetName="PART_HorizontalScrollBar"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="VerticalMetroScrollViewerStyle"
           TargetType="{x:Type ScrollViewer}">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Border x:Name="Bd">
                        <Grid>
                            <Border>
                                <ScrollContentPresenter></ScrollContentPresenter>
                            </Border>
                            <ScrollBar x:Name="PART_VerticalScrollBar"
                                       Value="{TemplateBinding VerticalOffset}"
                                       Maximum="{TemplateBinding ScrollableHeight}"
                                       ViewportSize="{TemplateBinding ViewportHeight}"
                                       Visibility="Collapsed" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver"
                                 Value="True"
                                 SourceName="Bd">
                            <Setter Property="Visibility"
                                    Value="Visible"
                                    TargetName="PART_VerticalScrollBar"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="HorizontalMetroListBoxStyle"
           TargetType="{x:Type ListBox}">
        <Setter Property="Background"
                Value="Transparent"></Setter>
        <Setter Property="BorderThickness"
                Value="0"></Setter>
        <Setter Property="FontFamily"
                Value="Segoe UI"></Setter>
        <Setter Property="Foreground"
                Value="White"></Setter>
        <Setter Property="FontSize"
                Value="15"></Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"></StackPanel>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <ScrollViewer Style="{StaticResource HorizontalMetroScrollViewerStyle}">
                        <Border>
                            <ItemsPresenter></ItemsPresenter>
                        </Border>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="VerticallMetroListBoxStyle"
           TargetType="{x:Type ListBox}">
        <Setter Property="Background"
                Value="Transparent"></Setter>
        <Setter Property="BorderThickness"
                Value="0"></Setter>
        <Setter Property="FontFamily"
                Value="Segoe UI"></Setter>
        <Setter Property="Foreground"
                Value="White"></Setter>
        <Setter Property="FontSize"
                Value="15"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <ScrollViewer Style="{StaticResource VerticalMetroScrollViewerStyle}">
                        <Border>
                            <ItemsPresenter></ItemsPresenter>
                        </Border>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="VerticallMetroItemsControlStyle"
           TargetType="ItemsControl">
        <Setter Property="Background"
                Value="Transparent"></Setter>
        <Setter Property="BorderThickness"
                Value="0"></Setter>
        <Setter Property="FontFamily"
                Value="Segoe UI"></Setter>
        <Setter Property="Foreground"
                Value="White"></Setter>
        <Setter Property="FontSize"
                Value="15"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ItemsControl">
                    <ScrollViewer Style="{StaticResource VerticalMetroScrollViewerStyle}">
                        <Border>
                            <ItemsPresenter></ItemsPresenter>
                        </Border>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>